<!DOCTYPE html>
<html>
<head>
<script src="/js-test-resources/testharness.js"></script>
<script src="/js-test-resources/testharnessreport.js"></script>
<script>

if (window.testRunner) {
    testRunner.setPopupBlockingEnabled(false);
    // Disallow insecure WebSockets.
    testRunner.overridePreference("WebKitAllowRunningInsecureContent", false);
}

var test = async_test("Test that when a HTTPS window that creates an insecure WebSocket connection is opened, the mixed content callback is triggered because the main frame in the window is HTTPS but is trying connecting to an insecure WebSocket server.");
test.step(function ()
{
    window.addEventListener("message", test.step_func(function (evt) {
        assert_equals(evt.data, "DONE", "evt.data");
        test.done();
    }), false);

    window.open("https://127.0.0.1:8443/security/mixedContent/websocket/resources/expect-throw-on-construction.html");
});

</script>
</head>
<body>
</body>
</html>
